from PyQt5 import QtWidgets, QtCore
from PyQt5.QtGui import QPalette,QColor
import os
import qss_rc
curpath=os.path.split(os.path.abspath(__file__))[0]
def darkStyle(dark):
    a=QtWidgets.qApp
    if dark:
        fname=os.path.join(curpath,"qss","blacksoft.css")
    else:
        fname=os.path.join(curpath,"qss","flatgray.css")
    f=open(fname, "r") 
    _style = f.read()
    f.close()
    paletteColor=_style[20:20+7]
    a.setPalette(QPalette(QColor(paletteColor)));
    a.setStyleSheet(_style);
def noStyle():
    a=QtWidgets.qApp
    a.setPalette(QPalette());
    a.setStyleSheet(None);    
def qingyun_style(a):
    fname=os.path.join(curpath,"qss","blacksoft.css")
    f=open(fname, "r") 
    _style = f.read()
    f.close()
    paletteColor=_style[20:20+7]
    a.setPalette(QPalette(QColor(paletteColor)));
    a.setStyleSheet(_style);
def github_style(a):
    fname=os.path.join(curpath,"qss","MaterialDark.qss")
    f=open(fname, "r")
    a.setStyleSheet(f.read());
    f.close()
def material_style(a):
    from qt_material import apply_stylesheet
    apply_stylesheet(a, theme='dark_cyan.xml') 
if __name__ == "__main__":
    # main()
    # testlink()
    pas
